<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Document</title>
</head>
<body>

  <div id='app'>
    <home></home>
  </div>

<template id="tpl">
  <div>
    <h2>父组件</h2>
    <common-head ></common-head>
  </div>
</template>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const CommonHead = {
    template: `
      <div>
        子组件
      </div>
    `
    ,data(){
      return {
        msg: '子组件'
      }
    }
    ,mounted(){
      console.log(this.$parent);
    }
  }
  const Home = {
    template: "#tpl"
    ,components: {
      CommonHead
    }
    ,data() {
      return {
        msg: '父组件'
      }
    }
    ,mounted() {
      console.log(this.$children);
    }
  }
  Vue.component("Home", Home)
  const app = new Vue({
    el: '#app'
    ,data: {
      msg: 'Hello Vue'
    }
  })
</script>
</body>
</html>